<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""DTD/xhtml1-strict.dtd">
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/c.tld" prefix="c"%>
<%@taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%>
<%@taglib uri="/WEB-INF/el.tld" prefix="el"%>
<%@taglib uri="/WEB-INF/fn.tld" prefix="fn"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<c:import url="/includes/css_inc.jsp"/>
		<c:import url="/includes/js_inc.jsp"/>
		<script>
			$(function(){
				$("#save").button({
		            icons: {
		                primary: "ui-icon-disk"
		            }
				});
				$("#edit").button({
		            icons: {
		                primary: "ui-icon-disk"
		            }
				}).click(function(){
					$("#job").val("edit");
					$("#saveForm").submit();
				});

				$("#btnSearch").button({
		            icons: {
		                primary: "ui-icon-search"
		            }
		        });
				$("#back").button({
		            icons: {
		                primary: "ui-icon-arrowreturnthick-1-w"
		            }
		        }).click(function() {
		        	$("#job").val("back");
		        	$("#saveForm").submit();
		        });
		        thaiDatepicker("incomeDate","#","1");

			});
		</script>
	</head>
	<body>
		<c:set var="auth" value="${el:getMapValue(menuAuth, 'ACC60202')}"/>
		<c:import url="/apps/msg.jsp"/>
		<form class="acc67-form" name="saveForm" id="saveForm" action="${pageContext.request.contextPath}/acc6" method="post">
		<input type="hidden" name="app" id="app" value="ACC60201"/>
		<input type="hidden" name="job" id="job" value="save"/>
		<input type="hidden" name="docNo" id="docNo" value="${incomeBean.docNo}"/>
			<table width="100%" class="ui-widget ui-widget-content" border="0">
				<tr>
					<th align="left" class="acc67-header ui-widget-header" colspan="2"><b>${screenCode.ACC60202}</b></th>
				</tr>
				<tr>
					<td width="20%" class="bold">เลขที่เอกสาร : </td>
					<td>${incomeBean.docNo}</td>
				</tr>
				<tr>
					<td class="bold">ปีงบประมาณ : </td>
					<td>
						<select name="budgetYear" id="budgetYear">
							<option value="">----- เลือก -----</option>
							<c:if test="${!empty listBudgetYear}">
								<c:forEach var="data" items="${listBudgetYear}" varStatus="x">
									<c:if var="selected" test="${data.BUDGET_YEAR == incomeBean.budgetYear}"/>
									<option value="${data.BUDGET_YEAR}" ${selected ? 'selected' : ''}>${data.BUDGET_YEAR}</option>
								</c:forEach>
							</c:if>
						</select><span id="$budgetYear" class="red">*</span>
					</td>
				</tr>
				<tr>
					<td class="bold">วันที่รับเงิน : </td>
					<td><input type="text" name="incomeDate" id="incomeDate" value="${el:dateTh(incomeBean.incomeDate)}"><span id="#incomeDate" class="red">*</span></td>
				</tr>
				<tr>
					<td class="bold">จำนวนเงิน : </td>
					<fmt:formatNumber var="amount" pattern="#,##0.00" value="${incomeBean.amount}"/>
					<td><input type="text" name="amount" id="amount" onkeypress="return numberOnly(event);" value="${amount}"/><span id="#amount" class="red">*</span></td>
				</tr>
				<tr>
					<td class="bold" valign="top">คำอธิบายรายการ : </td>
					<td>
						<textarea cols="40" rows="5" name="incomeDesc" id="incomeDesc">${incomeBean.incomeDesc}</textarea>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						<c:if test="${isEdit == 'N'}">
							<c:if test="${fn:contains(auth, 'I')}">
								<button type="submit" name="save" id="save"  class="acc67-button">บันทึกข้อมูล</button>
							</c:if>
						</c:if>
						<c:if test="${isEdit == 'Y'}">
							<c:if test="${fn:contains(auth, 'U')}">
								<button type="button" name="edit" id="edit"  class="acc67-button">บันทึกข้อมูล</button>
							</c:if>
						</c:if>
						<button type="button" name="back" id="back"  class="acc67-button">ย้อนกลับ</button>
					</td> 
				</tr>
			</table>
		</form>
	</body>
</html>